import requests
from dataclasses import dataclass, asdict
from models.customer_Data import CustomerData
from controller.base_controller import BaseController

class CustomerController(BaseController):

    def add(self,cunsomer_data:CustomerData):
        url = 'http://v5.crmeb.net/adminapi/user/user'
        headers = {"Content-Type" : "application/json","Authori-zation" : "Bearer "+self.token}
        res = self.requests.post(url=url,headers=headers,json=asdict(cunsomer_data))
        json_data = res.json()
        return json_data